/*
 * Copyright (C) 2009 Luc Boudreau
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */
package com.encon.projecttracker.server.data.impl;

import java.util.List;

import com.encon.projecttracker.server.data.TestManager;
import com.encon.projecttracker.server.data.pojo.Test;



public class TestManagerImpl extends AbstractManager implements TestManager {

    public void createTest(Test group) {
        getHibernateTemplate().save(group);
    }

    public void createDefaultTest(Test group) {
        this.createTest(group);
    }

    public void updateTest(Test group) {
        getHibernateTemplate().update(group);
    }

    public void updateDefaultTest(Test group) {
        this.updateTest(group);
    }

    public Test getTest(final String testId)
    {
        List<Test> test = getHibernateTemplate().find("from Test where id = ?", testId); //$NON-NLS-1$
        return test.isEmpty()?null:test.get(0);
    }

}
